package com.google.code.wicket.auth.component.value.provider;

import java.util.Collection;

/**
 * An adapter for {@link ValueProvider} that lets you implement only
 * {@link #getValues()} and throws an {@link UnsupportedOperationException} if
 * {@link #hasValue(Object)} is called.
 * 
 * @param <T>
 *            the value type
 */
public abstract class MultiValueProvider<T> implements ValueProvider<T> {

    /**
     * {@inheritDoc}
     */
    @Override
    public abstract Collection<T> getValues();;

    /**
     * Will throw an {@link UnsupportedOperationException}.
     */
    @Override
    public final boolean hasValue(final T value) {
        throw new UnsupportedOperationException();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public final boolean useSingle() {
        return false;
    }

}
